package cn.migu.music.hangupsms.cachemanage;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.migu.music.hangupsms.cachemanage.event.ReLoadDbCacheEvent;
import cn.migu.music.hangupsms.cachemanage.handler.subhandler.ReloadAllDbHandle;

/**
 * demo
 *
 * @author tanxiao
 * @date 2020/9/24 15:12
 */
@RestController
public class RefreshDBLocalCacheControllerDemo {
    @Autowired
    private LocalCacheManager cacheManager;

    /**
     * 刷新soap-addr缓存
     * 
     * @return
     */
    @GetMapping("/bus/refreshSoapAddr")
    public boolean refreshSoapAddr() {
        ReLoadDbCacheEvent event = new ReLoadDbCacheEvent();
        event.setCacheKey(ReloadAllDbHandle.CACHE_HANDLER_NAME);
        cacheManager.broadcastEvent(event);

        return true;
    }
}
